//
//  GLESVertexBufferObject.h
//  VertexBufferObject
//
//  Created by 畑圭輔 on 10/03/28.
//  Copyright 2010 Keisuke Hata. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GLESData.h"
#import "Texture2D.h"

typedef struct {
	
	Vector2F pos;		// VBO頂点位置( 8byte * 6 ) => 精度を求めないのならば、SHORTが良い
	Color4F  colors;	// VBO頂点カラー( 16byte * 6 )
	Vector2F uv;		// VBOテクスチャUV
	
}VBOTexturedVertex;

// テクスチャ+ピクセル
typedef struct {
	
	VBOTexturedVertex pixels[3*2]; // 3頂点 * 2 => 四角
		
}VBOTexturedPixel;

@interface GLESTexturedVertexBufferObject : NSObject {
	
	VBOTexturedPixel *_pixels;
	Texture2D        *_texture;
	NSInteger		  _gridSize;
	NSInteger		  _gridWidthNum;
	NSInteger		  _gridHeightNum;
	NSInteger		  _gridTotalNum;
	
	GLuint			  _vboID;

}

- (id) initWithGrid : (NSString *)path vboGridSize:(float)gridSize;

- (void) presentBuffer;
- (void) draw;	

@end
